//
// Created by Administrator on 2022/7/7.
//
#include "Tree.cpp"
//对一颗以孩子兄弟链表表示的树统计其叶子结点个数
int countl(Tree root){
    int count=0;
    if(root==NULL){
        return 0;
    }else{
        //递归结束条件为节点的左孩子为空
        if(root->leftChild==NULL){
            count++;
        }
        count+=countl(root->leftChild);
        count+=countl(root->rightChild);
    }
    return count;
}
int main(){
    Tree tree= CreateTreeByFile("Day-616-1.txt");
    printf("%d",countl(tree));
}